<template>
    <div class="user-box" v-if="userInfo.ID">
        <div class="icon">
            <el-image
                style="width: 100%;height: 100%;"
                :src="userInfo.usericon"
                fit="cover"
                :preview-src-list="[userInfo.usericon]"
            ></el-image>
        </div>
        <div class="user-name">{{userInfo.username}}</div>
        <div class="user-name">{{userInfo.brief}}</div>
        <div class="contact">
            <div class="item show-wrop">
                <img :src="userInfo.yxicon" :alt="userInfo.email">
                <div class="show-tips">{{userInfo.email}}</div>
            </div>
            <div class="item show-wrop">
                <img :src="userInfo.wxicon" alt="微信">
                <div class="show-tips">
                    <img :src="userInfo.wx" alt="微信">
                </div>
            </div>
            <div class="item show-wrop">
                <img :src="userInfo.addressicon" alt="地址">
                <div class="show-tips">{{userInfo.address}}</div>
            </div>
            <div class="item show-wrop">
                <img :src="userInfo.wxAppleticon" alt="微信小程序">
                <div class="show-tips">
                    <img :src="userInfo.wxApplet" alt="微信小程序">
                </div>
            </div>
        </div>
    </div>
</template>
<script>
export default {
    name: 'UserInfo',
    props: {
        userInfo: {
            type: Object,
            default: () => ({})
        }
    },
    data() {
        return {
            
        }
    }
}
</script>
<style lang="scss" scoped>
.user-box{
    background-color: #fff;
    border: #fff;
    margin: 0 auto 20px;
    padding: 16px;
    box-shadow: 0 4px 8px 6px rgba(7, 17, 21, 0.06);
    border-radius: 8px;
    cursor: pointer;
    &:hover{
        box-shadow: 0 4px 8px 10px rgba(7, 17, 21, 0.1);
    }
    .icon{
        width: 80px;
        height: 80px;
        border-radius: 50%;
        overflow: hidden;
        margin: 0 auto;
        box-shadow: 0 4px 8px 6px rgba(7, 17, 21, 0.06);
        img{
            width: 100%;
            object-fit: cover;
        }
    }
    .user-name{
        padding-top: 10px;
        text-align: center;
    }
    .contact{
        display: flex;
        justify-content: center;
        align-items: center;
        .item{
            width: 25px;
            height: 25px;
            margin: 10px 5px;
            position: relative;
            img{
                width: 100%;
            }
        }
        .show-wrop{
            &:hover{
                .show-tips{
                    transform: scale(1);
                }
            }
        }
        .show-tips{
            background-color: #fff;
            border: #fff;
            padding: 8px;
            box-shadow: 0 4px 8px 6px rgba(7, 17, 21, 0.06);
            position: absolute;
            border-radius: 8px;
            top: 34px;
            left: 10px;
            transition: all .3s;
            transform: scale(0);
            img{
                width: 100px;
                height: 100px;
            }
        }
        .address{
            // top: -10px;
            left: -80px;
        }
    }
}
</style>